import API from '@/services/api'
import {request, METHOD} from '@/utils/request'

/**
 * 获取临时上传地址
 * @param params 请求参数
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getSignedUploadFileUrl(params) {
  return request(API.UPLOAD_FILE_GET_SIGNED_UPLOAD_FILE_URL, METHOD.POST, params)
}

/**
 * 获取临时上传地址(原始文件名)
 * @param params 请求参数
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getSignedUploadFileUrlOriginName(params) {
  return request(API.UPLOAD_FILE_GET_SIGNED_UPLOAD_FILE_URL_ORIGIN_NAME, METHOD.POST, params)
}

export default {
  getSignedUploadFileUrl,
  getSignedUploadFileUrlOriginName
}
